﻿//-----------------------------------------------------------------------
// <copyright file="Logger.cs" company="Panchal Softwares">
//     Copyright (c) Panchal Softwares. All rights reserved.
// </copyright>
// <author>Karn Panchal</author>
//-----------------------------------------------------------------------

/// <summary>
/// Namespace Text Finder Library.
/// </summary>
namespace PanchalSoftwares.TextFinder.Library
{
    using System;
    using System.IO;

    /// <summary>
    /// Class Logger.
    /// </summary>
    public class Logger
    {
        /// <summary>
        /// Writes the log.
        /// </summary>
        /// <param name="log">The log.</param>
        public static void WriteLog(string log)
        {
            string path = Path.Combine(Environment.CurrentDirectory, Properties.Resources.LogFileName);
            bool append = true;
            StreamWriter writer = new StreamWriter(path, append);
            log = string.Format("{0} - {1}", DateTime.Now, log);
            writer.WriteLine(log);
            writer.Flush();
            writer.Close();
        }
    }
}
